package com.open.capacity.notice.vo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.open.capacity.notice.dmo.MessageRececiverDetail;
import com.open.capacity.notice.dmo.MessageRececiverGroup;
import com.open.capacity.notice.enums.RececiverType;

import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 * 
 * @since 2024-05-07
 */
@Data
@SuppressWarnings("all")
@NoArgsConstructor
public class MessageRececiverGroupVO implements Serializable {

	private String id;

	/**
	 * 删除标识：1-删除，0-正常
	 */
	@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
	private Integer delFlag;

	private List<MessageRececiverDetail> recevivers;

	@ApiModelProperty(value = "创建人")
	private String createUser;

	@ApiModelProperty(value = "创建者id")
	private String createUserId;

	@ApiModelProperty(value = "创建时间")
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	@ApiModelProperty(value = "修改人")
	private String updateUser;

	@ApiModelProperty(value = "更新者Id")
	private String updateUserId;

	@ApiModelProperty(value = "修改时间")
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date updateTime;

	@ApiModelProperty(value = "接收组名称")
	private String name;

	@ApiModelProperty(value = "接收人类型")
	@Setter(AccessLevel.PRIVATE)
	private RececiverType receciverType;

	@ApiModelProperty(value = "备注")
	private String remark;

	public MessageRececiverGroupVO(MessageRececiverGroup MessageRececiverGroup) {
		if (Objects.nonNull(MessageRececiverGroup)) {
			setId(MessageRececiverGroup.getId());
			setCreateUser(MessageRececiverGroup.getCreateUser());
			setCreateUserId(MessageRececiverGroup.getCreateUserId());
			setCreateTime(MessageRececiverGroup.getCreateTime());
			setDelFlag(MessageRececiverGroup.getDelFlag());
			setUpdateUser(MessageRececiverGroup.getUpdateUser());
			setUpdateUserId(MessageRececiverGroup.getUpdateUserId());
			setUpdateTime(MessageRececiverGroup.getUpdateTime());
			setName(MessageRececiverGroup.getName());
			setRececiverType(MessageRececiverGroup.getRececiverType());
			setRemark(MessageRececiverGroup.getRemark());
		}
	}

}
